package com.twt.recruit.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.twt.recruit.entity.Category;
import com.twt.recruit.entity.vo.CategoryParam1;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface CategoryMapper extends BaseMapper<Category> {

    @Select("select * from category where project_id = #{projectId} and group_id is null")
    List<CategoryParam1> getCategoryIdsByProjectId(Integer projectId);

    @Select("select * from category where project_id = #{projectId} and group_id =#{groupId}")
    List<CategoryParam1> getCategoryIdsByProjectIdAndGroupId(Integer projectId, Integer groupId);

    @Delete("delete from category where project_id = #{projectId}")
    void delCategoryByProjectId(Integer projectId);
}
